package com.base.api.controller.selfApplyRefund;

import com.base.api.dto.commodity.CommodityDetailDTO;
import com.base.api.dto.selfApplyRefund.ApplyRefundDTO;
import com.base.api.service.selfApplyRefund.SelfApplyRefundApiService;
import com.base.log.WebLog;
import com.base.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/api/selfApplyRefund")
@Api(tags = "退款")
public class SelfApplyRefundApiController {

    private final SelfApplyRefundApiService selfApplyRefundApiService;

    public SelfApplyRefundApiController(SelfApplyRefundApiService selfApplyRefundApiService) {
        this.selfApplyRefundApiService = selfApplyRefundApiService;
    }

    @ApiOperation(value="退款申请")
    @PostMapping(value = "/applyRefund", produces = "application/json;charset=UTF-8")
    @WebLog
    public ResponseResult applyRefund(final @Validated ApplyRefundDTO applyRefundDTO){
        return selfApplyRefundApiService.applyRefund(applyRefundDTO);
    }
}
